<template>
  <div>
    <ul>
      {{index}}
      <li @click="chooseCity(title)">{{title}}</li>
    </ul>
    <slot/>
  </div>
</template>
<script>console.log(this)
export default {
  props: ['title', 'index', 'action'],
  data () {
    return {
      data1: '',
      userName: ''
    }
  },
  methods: {
    chooseCity: function (name) {
      this.$emit('childToParent', name)
      // console.log(this.action)
      // this.action(name)
    }
  }
}
</script>
<style scoped>
  input{
    border: 1px solid #ccc;
  }
</style>
